Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: first level pseudo-element def with extend in structure mode #2888

Merged
merged 1 commit into from
Jul 9, 2023

Conversation

idoros
Copy link
Collaborator

@idoros idoros commented Jul 8, 2023

This PR fixes a pseudo-element missed case with the new @st structure definition.

When defining a class with pseudo-element and extend, it is expected to resolve the name of the pseudo-element to it's top definition in the inheritance chain:

@st .base {
    @st ::part => .part-base;
}
@st .top :is(.base) {
    @st ::part => .part-top;
}

/* expect to resolve ::part to ".part-top" */
.top::part {}

This doesn't work before this PR because the infer selector process preferred to skip the first resolved symbol (start at .base instead of .top). This is due to legacy flat mode implicitly defining any local class as a pseudo-element of the .root class. Skipping the first resolved symbol allowed targeting both extended parts through pseudo-element syntax or local directly using class syntax.

This is no longer necessary in structure mode, because there are no implicit parts.

@idoros idoros added bug Unexpected behavior or exception core Processing and transforming logic labels Jul 8, 2023
@idoros idoros requested a review from barak007 July 8, 2023 08:36
@idoros idoros self-assigned this Jul 8, 2023
@idoros idoros changed the title fix: first level pseudo-element def with extend fix: first level pseudo-element def with extend in structure mode Jul 8, 2023
@idoros idoros merged commit 151f903 into master Jul 9, 2023
18 checks passed
@idoros idoros deleted the ido/fix-local-structure-selector-infer branch July 9, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior or exception core Processing and transforming logic
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants